import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './applylist.css'
import { AtSwipeAction,AtList, AtListItem,AtButton } from "taro-ui"
import { getGlobalData} from '../../../global';
import reactMixin from 'react-mixin';
import myJs from './applylistJs.js'
import app from '../../../main.js'
export default class ApplyList extends Component {

  config = {
    navigationBarTitleText: '好友申请列表'
  }
  constructor () { 
        super(...arguments); 
        this.state = this.getData(); 
    }
    
  init() {}

  render() {
    return (
      <View className='apply-list'>
        <AtList>
      {
        this.state.doctor_contacts.items.map((item) =>{ 
          return(<AtSwipeAction options={[
            {
              text: '取消',
              style: {
                backgroundColor: '#6190E8'
              }
            },
            {
              text: '删除',
              style: {
                backgroundColor: '#FF4949'
              }
            }
          ]}>
          {item.status == '接受' ? (
            <View className='line'>
              <AtButton className='agree-btn' size='small'>接受</AtButton>
              <AtListItem title={item.member_name} thumb={item.member_head_image} />
            </View>
            ) : (
            <AtListItem title={item.member_name} thumb={item.member_head_image} extraText={item.status}/>
          )}
          </AtSwipeAction>);
      }) 
    }
</AtList>
      </View>
    )
  }
}
reactMixin.onClass(ApplyList,myJs);